# -*- coding: utf-8 -*-
# @Time: 2022/4/29 13:45
# @Author: 发抖的小喵喵
# @Email: panyi_20210601@163.com
# @File: 潮豆冻结.py
# @Project: haixin
# @Software: PyCharm

from test_case.haixin.Method.Post import post_method
from random import randint
import time


def chioFreeze():
    """
    在收银台支付时，客户选择使用潮豆抵扣时，调用我们平台冻结潮豆
    :return:
    """

    url = "https://api-pre.shwoody.com/ma/chiobeansOrder/chioFreeze"

    data = {
        "shopId": "80102",   # 雷阳洪店铺3 shop表-shop_number
        "cashNo": "0007",   # 收款机号
        "saleNo": time.strftime("%Y%m%d%H%M%S") + str(randint(10000, 99999)),     # 销售流水号  测试潮豆冻结不需要更换saleNo
        "userId": "1767333916777209880",  # 下单的用户id  1772912663152635911
        "chiobeansNum": 100
    }
    print(f"saleNo:{data.get('saleNo')}")
    response = post_method(data, url)
    print("接口响应数据：" + str(response))


if __name__ == "__main__":
    chioFreeze()
